<!--#include file="../config.asp" -->
<!--#include file="../conn.asp" -->
<!--#include file="../inc/EasyIDE.asp" -->
<!--#include file="../inc/SysFunction.asp" -->
<%levelArray = userLevel()%>
<%
if levelArray(0)="0" or levelArray(0)="1" then
	sql = "select * from cw_colleges"
	sql_max = "select max(collegeid) as maxId from cw_colleges"
elseif levelArray(0)="2" then
	sql = "select * from cw_colleges where collegeid="&levelArray(1)
	sql_max = "select max(collegeid) as maxId from cw_colleges where collegeid="&levelArray(1)
end if
set rs = ado_query(sql)
set rs_max = ado_query(sql_max)
if not rs.eof then
	echo "{""collegeData"":["
	do while not rs.eof
		if rs("collegeid")=rs_max("maxId") then
			echo "{""collegeid"":"""&rs("collegeid")&""",""collegename"":"""&rs("collegename")&"""}"
		else
			echo "{""collegeid"":"""&rs("collegeid")&""",""collegename"":"""&rs("collegename")&"""},"
		end if
	rs.movenext
	loop
	echo "]}"
end if
rs.close : set rs = nothing
rs_max.close : set rs_max = nothing
conn.close : set conn = nothing
%>